package com.mallcloud.mall.app.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mallcloud.mall.common.core.util.R;
import com.mallcloud.mall.mall.api.entity.MallOrderModel;
import com.mallcloud.mall.mall.service.MallOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

// TODO 暂存xgl立牌订单
@Api(tags = "app-订单")
@RestController
@AllArgsConstructor
@RequestMapping("/app/order")
public class AppOrderController {
	private final MallOrderService mallOrderService;

	@ApiOperation("xgl立牌支付分页")
	@GetMapping("/xglPage")
	public R<IPage<MallOrderModel>> xglPage(Page page, MallOrderModel dto) {
		return R.ok(mallOrderService.xglPageOrder(page, dto));
	}

	@ApiOperation("新增")
	@PostMapping("/save")
	public R<Boolean> save(@RequestBody MallOrderModel orderModel) {
		return R.ok(mallOrderService.save(orderModel));
	}

}
